﻿<%@ Page Language="C#" AutoEventWireup="true" Codebehind="Login.aspx.cs" Inherits="LabMS.Web.Login" %>

<html>
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>重庆大学城环学院实验室管理系统</title>
    <style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	overflow:hidden;
}
.STYLE3 {font-size: 12px; color: #adc9d9; }
-->
</style>
    <!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" media="screen" href="css/ie.css" />
<![endif]-->
</head>
<body>
    <form id="form1" runat="server">
        <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td bgcolor="#1075b1">
                    &nbsp;</td>
            </tr>
            <tr>
                <td height="608" background="images/login_03.gif">
                    <table width="847" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td height="318" background="images/login_04.gif">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td height="84">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="381" height="84" background="images/login_06.gif">
                                            &nbsp;</td>
                                        <td width="162" valign="middle" background="images/login_07.gif">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td width="44" height="24" valign="bottom">
                                                        <div align="right">
                                                            <span class="STYLE3">用户</span></div>
                                                    </td>
                                                    <td width="10" valign="bottom">
                                                        &nbsp;</td>
                                                    <td height="24" colspan="2" valign="bottom">
                                                        <div align="left">
                                                            <input type="text" runat="server" name="txtUserName" id="txtUserName" style="width: 100px;
                                                                height: 17px; background-color: #87adbf; border: solid 1px #153966; font-size: 12px;
                                                                color: #283439;" />
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td height="24" valign="bottom">
                                                        <div align="right">
                                                            <span class="STYLE3">密码</span></div>
                                                    </td>
                                                    <td width="10" valign="bottom">
                                                        &nbsp;</td>
                                                    <td height="24" colspan="2" valign="bottom">
                                                        <input type="password" runat="server" name="txtUserPass" id="txtUserPass" style="width: 100px;
                                                            height: 17px; background-color: #87adbf; border: solid 1px #153966; font-size: 12px;
                                                            color: #283439;"></td>
                                                </tr>
                                                <!--
                                                <tr>
                                                    <td height="24" valign="bottom">
                                                        <div align="right">
                                                            <span class="STYLE3">验证码</span></div>
                                                    </td>
                                                    <td width="10" valign="bottom">
                                                        &nbsp;</td>
                                                    <td width="52" height="24" valign="bottom">
                                                        <input type="text" name="txtValidateCode" id="txtValidateCode" style="width: 50px;
                                                            height: 17px; background-color: #87adbf; border: solid 1px #153966; font-size: 12px;
                                                            color: #283439;" /></td>
                                                    <td width="62" valign="bottom">
                                                        <div align="left">
                                                            <img src="ValidateCode.ashx" alt="" width="47" height="14" style="cursor: pointer;" onclick="var r = Math.random(); alert(r);this.src='ValidateCode.ashx?t=r';" /><!-- <img src="images/yzm.gif" width="38" height="15" /> -->
                                                <!--
                                                        </div>
                                                    </td>
                                                </tr>-->
                                                <tr>
                                                    <td height="24" valign="bottom">
                                                        <div align="right">
                                                            <span class="STYLE3">类型</span></div>
                                                    </td>
                                                    <td width="10" valign="bottom">
                                                        &nbsp;</td>
                                                    <td height="24" colspan="2" valign="bottom">
                                                        <asp:DropDownList ID="DDLType" runat="server" Style="width: 100px; height: 17px;
                                                            background-color: #87adbf; border: none; border: solid 1px #153966; font-size: 12px;
                                                            color: #283439; outline: none;">
                                                            <asp:ListItem Value="0" Text="管理员"></asp:ListItem>
                                                            <asp:ListItem Value="2" Text="学生"></asp:ListItem>
                                                            <asp:ListItem Value="1" Text="老师"></asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="26">
                                            <img src="images/login_08.gif" width="26" height="84" /></td>
                                        <td width="67" background="images/login_09.gif">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td height="25">
                                                        <div align="center">
                                                            <asp:ImageButton ID="btnLogin" src="images/dl.gif" Width="57" Height="20" runat="server"
                                                                OnClick="btnLogin_Click" OnClientClick="if(!loginValid()){return false;}" />
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td height="25">
                                                        <div align="center">
                                                            <img src="images/cz.gif" style="cursor: pointer" onclick="rest();" width="57" height="20" /></div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="211" background="images/login_10.gif">
                                            &nbsp;</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td height="206" background="images/login_11.gif" valign="top" align="center">
                                <div style="margin-top: 15px; height: 12px; line-height: 12px;">
                                    <asp:Label ID="lbErr" runat="server" Style="color: #e49227; font-size: 12px;"></asp:Label></div>
                                <div style="margin-top: 45px; text-align: center; font-size: 12px; color: #cccccc;">
                                    版权所有&copy; 2009 重庆大学城环学院
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td bgcolor="#152753">
                    &nbsp;</td>
            </tr>
        </table>

        <script type="text/javascript">
        function rest()
        {
            document.getElementById("txtUserName").value = "";
            document.getElementById("txtUserPass").value = "";
            document.getElementById("DDLType").value = "0";
            document.getElementById("lbErr").innerHTML = "";
        }

        function loginValid(){
            var userName = document.getElementById("txtUserName");
            var userPass = document.getElementById("txtUserPass");
            var msg = document.getElementById("lbErr");

            if (userName.value.length < 1){
                msg.innerHTML = '用户名不能为空!';
                userName.focus();
                return false;
            }

            if (userPass.value.length < 1){
                msg.innerHTML = '用户密码不能为空!';
                userPass.focus();
                return false;
            }

            return true;
        }
        </script>

    </form>
</body>
</html>
